package com.yida.gwj.scene.expend.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yida.common.core.utils.DateUtils;
import com.yida.gwj.common.domain.GwjBaseOwner;
import com.yida.gwj.scene.expend.domain.GwjSceneExpendBusinessOwner;
import com.yida.gwj.scene.expend.mapper.GwjSceneExpendBusinessOwnerMapper;
import com.yida.gwj.scene.expend.service.IGwjSceneExpendBusinessOwnerService;

/**
 * 业务业主信息（旧支出模块）Service业务层处理
 * 
 * @author hmh
 * @date 2023-08-14
 */
@Service
public class GwjSceneExpendBusinessOwnerServiceImpl implements IGwjSceneExpendBusinessOwnerService {
    @Autowired
    private GwjSceneExpendBusinessOwnerMapper gwjSceneExpendBusinessOwnerMapper;

    /**
     * 查询业务业主信息（旧支出模块）
     * 
     * @param bizOwnerId 业务业主信息（旧支出模块）主键
     * @return 业务业主信息（旧支出模块）
     */
    @Override
    public GwjSceneExpendBusinessOwner selectGwjSceneExpendBusinessOwnerByBizOwnerId(Long bizOwnerId) {
        return gwjSceneExpendBusinessOwnerMapper.selectGwjSceneExpendBusinessOwnerByBizOwnerId(bizOwnerId);
    }

    /**
     * 查询业务业主信息（旧支出模块）列表
     * 
     * @param gwjSceneExpendBusinessOwner 业务业主信息（旧支出模块）
     * @return 业务业主信息（旧支出模块）
     */
    @Override
    public List<GwjSceneExpendBusinessOwner> selectGwjSceneExpendBusinessOwnerList(GwjSceneExpendBusinessOwner gwjSceneExpendBusinessOwner) {
        return gwjSceneExpendBusinessOwnerMapper.selectGwjSceneExpendBusinessOwnerList(gwjSceneExpendBusinessOwner);
    }

    /**
     * 新增业务业主信息（旧支出模块）
     * 
     * @param gwjSceneExpendBusinessOwner 业务业主信息（旧支出模块）
     * @return 结果
     */
    @Override
    public int insertGwjSceneExpendBusinessOwner(GwjSceneExpendBusinessOwner gwjSceneExpendBusinessOwner) {
        gwjSceneExpendBusinessOwner.setCreateTime(DateUtils.getNowDate());
        return gwjSceneExpendBusinessOwnerMapper.insertGwjSceneExpendBusinessOwner(gwjSceneExpendBusinessOwner);
    }

    /**
     * 修改业务业主信息（旧支出模块）
     * 
     * @param gwjSceneExpendBusinessOwner 业务业主信息（旧支出模块）
     * @return 结果
     */
    @Override
    public int updateGwjSceneExpendBusinessOwner(GwjSceneExpendBusinessOwner gwjSceneExpendBusinessOwner) {
        gwjSceneExpendBusinessOwner.setUpdateTime(DateUtils.getNowDate());
        return gwjSceneExpendBusinessOwnerMapper.updateGwjSceneExpendBusinessOwner(gwjSceneExpendBusinessOwner);
    }

    /**
     * 批量删除业务业主信息（旧支出模块）
     * 
     * @param bizOwnerIds 需要删除的业务业主信息（旧支出模块）主键
     * @return 结果
     */
    @Override
    public int deleteGwjSceneExpendBusinessOwnerByBizOwnerIds(Long[] bizOwnerIds) {
        return gwjSceneExpendBusinessOwnerMapper.deleteGwjSceneExpendBusinessOwnerByBizOwnerIds(bizOwnerIds);
    }

    /**
     * 删除业务业主信息（旧支出模块）信息
     * 
     * @param bizOwnerId 业务业主信息（旧支出模块）主键
     * @return 结果
     */
    @Override
    public int deleteGwjSceneExpendBusinessOwnerByBizOwnerId(Long bizOwnerId) {
        return gwjSceneExpendBusinessOwnerMapper.deleteGwjSceneExpendBusinessOwnerByBizOwnerId(bizOwnerId);
    }

    /* 
     * 批量插入用户数据
     */
    @Override
    public int insertBatchGwjSceneExpendBusinessOwner(Long bizId, List<GwjBaseOwner> owners) {
        return gwjSceneExpendBusinessOwnerMapper.insertBatchGwjSceneExpendBusinessOwner(bizId, owners);
    }

    /* 
     * 根据业务ID删除业主
     */
    @Override
    public int deleteGwjSceneExpendBusinessOwnerByBizId(Long bizId) {
        return gwjSceneExpendBusinessOwnerMapper.deleteGwjSceneExpendBusinessOwnerByBizId(bizId);
    }

    /* 
     * 根据业务ID和房屋标识码查询业主信息
     */
    @Override
    public GwjSceneExpendBusinessOwner selectGwjSceneExpendBusinessOwnerByBizIdAndHouseCode(Long bizId, String houseCode) {
        return gwjSceneExpendBusinessOwnerMapper.selectGwjSceneExpendBusinessOwnerByBizIdAndHouseCode(bizId, houseCode);
    }

    /**
     * 根据业务ID和房屋编号修改业务业主信息
     * 
     * @param gwjSceneExpendBusinessOwner
     * @return
     */
    @Override
    public int updateGwjSceneExpendBusinessOwnerByBizIdAndHouseCode(GwjSceneExpendBusinessOwner gwjSceneExpendBusinessOwner) {
        return gwjSceneExpendBusinessOwnerMapper.updateGwjSceneExpendBusinessOwnerByBizIdAndHouseCode(gwjSceneExpendBusinessOwner);
    }

    /* 
     * 批量更新用户数据
     */
    @Override
    public int updateBatchGwjSceneExpendBusinessOwner(List<GwjSceneExpendBusinessOwner> ownerList) {
        return gwjSceneExpendBusinessOwnerMapper.updateBatchGwjSceneExpendBusinessOwner(ownerList);
    }
}
